/**
 * 剑指 Offer 58 - II. 左旋转字符串
 * https://leetcode-cn.com/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/
 */

/**
 * @param {string} s
 * @param {number} n
 * @return {string}
 */
function reverseLeftWords(s, n) {
  return s.substr(n) + s.substr(0, n);
}

console.log(reverseLeftWords('abcdefg', 2) === 'cdefgab');
console.log(reverseLeftWords('lrloseumgh', 6) === 'umghlrlose');
